<template>
      <h2 style="text-align: center;">管理员投资列表</h2>
      <InvestInfoContent v-slot="info">
              <a @click="DeleteData(info.id)">删除</a>
      </InvestInfoContent>
</template>

<script setup lang="ts">
import InvestInfoContent from './InvestInfoContent.vue'
import axios from 'axios'

const DeleteData=(id:number)=>{
    if(confirm("确定删除吗？")){
        axios({
            url:"https://localhost:44354/api/Invests/ChangeInvsetStatus",
            method:"get",
            params:{
                  Iid:id
            }
        }).then(res=>{
            if(res.data>0)
            {
                  alert("删除成功")
                  location.reload()
            }
            else
            {
                  alert("删除失败")
            }
        }).catch(err=>{
            console.log(err);
        })
    }
}

</script>